#ifndef NOPOLL_RTTHREAD_H__
#define NOPOLL_RTTHREAD_H__

#include "nopoll.h"

#if defined(USING_MBED_TLS)
#include <tls_client.h>
#include "mbedtls/sha1.h"
#else 
#include <tiny_sha1.h>
#endif

#ifndef nopll_malloc
#define nopll_malloc                     rt_malloc
#endif

#ifndef nopll_calloc
#define nopll_calloc                     rt_calloc
#endif

#ifndef nopll_realloc
#define nopll_realloc                    rt_realloc
#endif

#ifndef nopll_free
#define nopll_free                       rt_free
#endif

#ifndef nopll_strdup
#define nopll_strdup                     rt_strdup
#endif



unsigned int nopoll_rtt_random(void);

nopoll_bool nopoll_rtt_base64_encode (const char  * content,
				  int           length,
				  char        * output,
				  int         * output_size);

nopoll_bool nopoll_rtt_base64_decode (const char * content,
				  int          length,
				  char       * output,
				  int        * output_size);

noPollPtr nopoll_calloc(size_t count, size_t size);
                  
noPollPtr nopoll_realloc(noPollPtr ref, size_t size);
                  
void nopoll_free (noPollPtr ref);
#endif
